package com.xiaowan.user.aop;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

/**
 * @Description
 * @Author Administrator
 * @Date 2019/12/3 0003 上午 10:04
 **/
@Component
@Aspect
public class UserAspect {

 /*   @Pointcut("execution(public void UserControlller.sam())")
    private void inTrading() {}*/

    //controller包的子包里面任何方法
    @Pointcut("execution(public * com.xiaowan.user.controller.*.*(..))")
    public void checkToken(){
    }


    @Before("execution(* testMapperXmlQuery(..))")
    public void testSpringAop(JoinPoint jp){
        System.out.println("test spring aop");
    }

    @Before("checkToken()")
    public void testSpringMvcAop(){
        System.out.println("test springMVC aop");
    }

}
